package model;

/**
 * Class extending Move moving the player back 3 spaces when drawn.
 * @author Group 20
 *
 */
public class MoveBack extends Move
{
	/**
	 * Constructor adds the value for description.
	 * @param description Card description
	 */
	public MoveBack(String description) {
		super(description);
	}

	/**
	 * Executes the consequence of the card, moving the player back 3 spaces.
	 */
	@Override
	public boolean draw(Player player) {
		int fieldNumber = player.getStandOnField();
		if(fieldNumber == 3)
		{
			player.setStandOnField(40);
		}
		else
		{
			player.setStandOnField(fieldNumber - 3);
		}
		payment = 0;
		return true;
	}
}
